#ifndef CBASE_H_
#define CBASE_H_

#include "stdafx.h"
#include "IBaseInterface.h"

enum ObjectTypes {OBJECT_BASE, OBJECT_PLAYER, OBJECT_MUMMY, OBJECT_RAT, OBJECT_BAT, OBJECT_SPIDER, OBJECT_SNAKE, OBJECT_ELEVATOR, 
				  OBJECT_WEB, OBJECT_TURRET, OBJECT_ARROW, OBJECT_SEEKARROW, OBJECT_SEEKTURRET, OBJECT_SPIKETRAP, OBJECT_SPEARTRAP,
				  OBJECT_FLAMETRAP, OBJECT_DOOR, OBJECT_LADDER};

class CBase : public IBaseInterface
{
private:
	float m_fXPos;		//X position
	float m_fYPos;		//Y position
	float m_fXVel;		//X velocity
	float m_fYVel;		//Y velocity
	int m_nImageID;		//Image ID index
	float m_fTimer;		//Timer for timing things
	int m_nWidth;		//Width of object
	int m_nHeight;		//Height of object
	unsigned int m_uiRefCount;

protected:
	int m_nType;		//Object Type 

public:
	CBase();
	virtual ~CBase();

	// Accessors
	int GetType()		{return m_nType;}
	float GetPosX()		{return m_fXPos;}
	float GetPosY()		{return m_fYPos;}
	float GetVelX()		{return m_fXVel;}
	float GetVelY()		{return m_fYVel;}
	int GetImageID()	{return m_nImageID;}
	float GetTimer()	{return m_fTimer;}
	int GetWidth()		{return m_nWidth;}
	int GetHeight()		{return m_nHeight;}

	// Mutators
	void SetType(int type)		{m_nType = type;}
	void SetPosX(float pos)		{m_fXPos = pos;}
	void SetPosY(float pos)		{m_fYPos = pos;}
	void SetVelX(float vel)		{m_fXVel = vel;}
	void SetVelY(float vel)		{m_fYVel = vel;}
	void SetImageID(int id)		{m_nImageID = id;}
	void SetTimer(float timer)	{m_fTimer = timer;}
	void SetWidth(int width)	{m_nWidth = width;}
	void SetHeight(int height)	{m_nHeight = height;}

	void AddRef() { m_uiRefCount++; }
	void Release()
	{
		m_uiRefCount--;

		if(!m_uiRefCount)
			delete this;
	}
	virtual void Update(float fElapsedTime);
	virtual void Render();
	void Input();
	bool CheckCollision(IBaseInterface* pBase);
	RECT GetRect();
};


#endif